Inference, Targeting and Compatibility in a Type System for Java with SAM Typed Closures

نویسندگان

  • Marco Bellia
  • M. Eugenia Occhiuto
چکیده

In this paper we consider the new type structure that has been proposed for Java closures, in the last Java Specification Language [BS11a]. This structure uses SAM types that are in fact, nominal types instead of the structural, functional types, used in the previous, proposals. In addition, it allows type inference for closures and for closure arguments. Through a technique, already consolidated in previous studies in Java extensions, we extend the calculus FGJ, [IPW01], with interfaces, anonymous classes, closures of the new form and SAM types. We define a type system and a reduction semantics for this calculus FGATCJ. Using the type system, we formalize the notions of closure context, target type, compatibility type and closure type as they emerge in [BS11a]. Eventually, we prove the soundness of the type system.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Linguistic Support for Large-Scale Distributed Programming

This paper presents linguistic primitives for publish/subscribe programming using events and objects. We integrate our primitives into a strongly typed objectoriented language through four mechanisms: (1) serialization, (2) multiple subtyping, (3) closures, and (4) deferred code evaluation. We illustrate our primitives through Java, showing how we have overcome its respective lacks. A precompil...

متن کامل

ScopeJ: A Multi-threaded Region Calculus

We introduce ScopeJ, a statically typed, multi-threaded, object calculus in which scopes are first class constructs which reify the notion of allocation context and provide a safe alternative to automatic memory management by ensuring linear time allocation and bulk deallocation. The design of ScopeJ has been driven by the requirement of the Real-time Specification for Java and backwards compat...

متن کامل

Intra - procedural Inference of Static Types for

In this paper, we present practical algorithms for inferring static types for local variables and stack locations of Java bytecode. By decoupling the type inference problem from the low level bytecode representation, and abstracting it into a constraint system, we are able to construct a sound and e cient algorithm for inferring the type of most bytecode found in practice. Using this same const...

متن کامل

Implementation of the Typed Call - by - Value - calculus using a Stack

We present a translation scheme for the polymorphi-cally typed call-by-value-calculus. All runtime values , including function closures, are put into regions. The store consists of a stack of regions. Region inference and eeect inference are used to infer where regions can be allocated and de-allocated. Recursive functions are handled using a limited form of polymor-phic recursion. The translat...

متن کامل

Finding References in JavaTM Stacks

Exact garbage collection for the strongly-typed Java language may seem straightforward. Unfortunately, a single pair of bytecodes in the Java Virtual Machine instruction set presents an obstacle that has thus far not been discussed in the literature. We explain the problem, outline the space of possible solutions, and present a solution utilizing bytecode-preprocessing to enable exact garbage c...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2012